package com.jgy.策略And工厂模式;


import com.jgy.策略模式.CountPrice;

/**
 * @author 姜光远
 * @date 2022/12/15 10:50
 */
public class StrategyFactory {
    public static CountPrice getCountPrice(String code)  {

        try {
            return (CountPrice) Class.forName(FactoryEnum.getClassNameByCode(code)).newInstance();
        } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
            e.printStackTrace();
        }
        return null;
    }
}
